﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zeus.Pattern.Singleton.Classic
{
    /// <summary>
    /// 经典设计模式中提出的实现方式
    /// </summary>
    public class ClassicSingleton
    {
        private static ClassicSingleton instance;   // 唯一实例
        protected ClassicSingleton() { }   // 封闭客户程序的直接实例化

        public static ClassicSingleton Instance
        {
            get
            {
                if (instance == null)
                    instance = new ClassicSingleton();
                return instance;
            }
        }
    }
}
